A storage device having a nonvolatile memory such as a flash memory, which is capable of rewriting data therein, has a high portability, and does not need backup by battery and the like, has been increasingly used as a storage device of portable devices handling music data and image data.
A prior art nonvolatile storage device having four 512-Mbit flash chips of 256 MB capacity will be explained with reference to FIG. 4 to FIG. 10.
FIG. 4 is a configuration view of the nonvolatile storage device.
In FIG. 4, 1 designates a nonvolatile storage device and 8 designates a data input/output device. The nonvolatile storage device 1 has nonvolatile storage mediums 2 (flash memories in a conventional embodiment and embodiments of the present invention) and a control part 3. The control part 3 further has a first translation table (an indirect address translation table) 4, a data validity table (a fourth table) 5, an entry table (a third table) 6 and an input/output control part 7.
The nonvolatile storage device 1 accepts various requests including write request, read request, clear request and so on from the data input/output device 8 through the input/output control part 7. The nonvolatile storage device 1 performs processings for the accepted various requests. In the case of the write request, data to be written is transferred from the data input/output device 8 to the nonvolatile storage device 1. In the case of the read request, data to be read out is transferred from the nonvolatile storage device 1 to the data input/output device 8. At the request accepted by the input/output control part 7, the control part 3 carries out writing, reading or clearing on the nonvolatile storage medium 2. The control part 3 also refers to and updates the first translation table 4, the data validity table 5 and the entry table 6.
FIG. 5 is a configuration view showing the nonvolatile storage medium 2 of the nonvolatile storage device 1.
In FIG. 5, 1-1, 1-2, . . . 1-2048, 2-1, . . . 8-2048 each designate a physical block. In the nonvolatile storage medium such as flash memory, data is cleared in the unit of physical blocks. The physical blocks 1-1, . . . 1-2048 are collectively referred to as a first physical block group. The same applies to a second physical block group to an eighth physical block group. A single nonvolatile storage medium 2 (storage element) consists of eight physical block groups, each group having 2048 (=211) physical blocks, thereby containing 16,384 (=214) physical blocks in total.
Further, a single physical block set consists of eight physical blocks selected from each of eight block groups. For example, as shown in the drawing, 1-1, 2-2, 3-3, 4-3, 5-2, 6-2048, 7-1 and 8-3 are collectively referred to as a first physical block set.
It takes time to write data in the nonvolatile storage medium 2. Therefore, the control part 3 writes eight input data in a physical block set at a time. By simultaneously writing data in eight physical blocks (one physical block set), bit width of data becomes eight times greater so that writing speed of the nonvolatile storage device 1 can be improved eight times faster. However, in the nonvolatile storage device 1, it is impossible to simultaneously write data in plural physical blocks of one and the same physical block group. The technique for simultaneously writing data in plural physical blocks of the nonvolatile memory has become publicly known. For example, data sheet of the nonvolatile memory TC58512FT manufactured by Kabushiki Kaisha Toshiba provides an explanation of multi-block program for simultaneously writing data in plural physical blocks.
FIG. 6 is a configuration view showing the first physical block set of the nonvolatile storage medium in the nonvolatile storage device.
In FIG. 6, the physical block 1-1 consists of eight partial logical blocks including 1-1A, 1-1B, 1-1C, . . . 1-1H. A single logical block is comprised of partial logical blocks that selected one by one in a sequential order, from all physical blocks included in the physical block set. For example, as shown in the drawing, 1-1A, 2-2A, 3-3A, 4-3A, 5-2A, 6-2048A, 7-1A and 8-3A are collectively referred to as a first logical block. One physical block and one logical block are each 32 pages, and one partial logical block is 4 pages.
FIG. 7 is a detail view showing a redundant area of the physical block of the nonvolatile storage medium in the nonvolatile storage device.
The partial logical block has a redundant area in addition to data. Each partial logical block of the first physical block group has a data validity flag in the redundant area. Some partial logical blocks of the first physical block group have a link table and a second translation table in the redundant area.
The second translation table is a table for translating logical addresses into physical addresses (physical addresses of partial logical blocks) of eight partial logical blocks included in the first physical block group. The link table is a table for physical addresses (physical addresses of partial logical blocks) of seven partial logical blocks (other than a partial logical block which is included in the first physical block group and has the link table) included in the second to eighth physical block groups. The validity flag is a flag for indicating whether the second translation table of the logical block is valid or invalid.
The second translation table may lie in the second to eighth physical block groups as well as the first physical block group.
A leading partial logical block of each physical block has first data capable of determining whether the physical block including the partial logical block has been cleared or not. Supposing that the first data is 8-bit data, when the data value is FFH, the physical block has been cleared, and when it is a value other than FFH, the physical block has not been cleared. The first data may be used for any purpose other than that of determining whether the physical block has been cleared or not.
Writing is performed in the unit of physical block sets and clearance is performed in the unit of physical blocks. Whether written data is valid or invalid can be determined in the unit of partial logical blocks.
FIG. 9 is a configuration view of the entry table 6.
In FIG. 9, numeral 0 or 1 represents the state of each physical block arranged in order of address 0, 1, 2, . . . . Numeral 0 indicates that writing has been completed and numeral 1 indicates that clearance has been completed. The entry table is prepared at initialization.
FIG. 10 is a configuration view of the data validity table 5.
In FIG. 10, numeral 0 or 1 represents validity of data written in each partial logical block of the first physical block group arranged in order of address 0, 1, 2, . . . . Numeral 0 indicates invalidity and numeral 1 indicates validity. Just like the entry table, the data validity table is prepared at initialization.
FIGS. 8A and 8B are flowcharts of operations of a third table generation means and a fourth table generation means at initialization of the conventional nonvolatile storage device. Part a of FIG. 8A is connected to part a of FIG. 8B.
In FIGS. 8A and 8B, at step 801, the third table generation means initializes all fields of the entry table by the default value 1 (cleared). At step 802, the fourth table generation means initializes all fields of the data validity table by the default value 0 (invalid). At step 803, the control part 3 initializes physical block number j in the physical block group by the default value 1. At step 804, the control part 3 initializes partial logical block number i in the physical block by the default value 1.
At step 805, the control part 3 reads . . . out the first partial logical block of the jth physical block in the first physical block group. At step 806, in accordance with the first data of a leading page of the physical block read out, the control part 3 determines whether the physical block is a cleared one or not. In the case of the cleared physical block, the entry table has been already initialized with the default value 1 (cleared) at the step 801 and the data validity table has been already initialized with the default value 0 (invalid) at the step 802. Therefore, the control part 3 completes processing of the jth physical block without doing anything. In the case where it is the written physical block, the operation proceeds to step 807 and the third table generation means writes 0 (written) in the field of the physical block of the entry table.
At step 809, the control part 3 determines whether the validity flag in redundant area is valid or not. In the case where the validity flag is invalid, the data validity table has been already initialized with the default value 0 (invalid) at the step 802, and therefore the control part 3 completes processing of the ith partial logical block without doing anything. In the case where the validity flag is valid, the operation proceeds to step 810 and the fourth table generation means writes 1 (valid) in the field of the partial logical block of the data validity table.
At step 811, the control part 3 adds 1 to the partial physical block number i in the physical block. At step 812, the control part 3 determines whether the partial logical block is a last one in the physical block or not, that is, i>8 or not. In the case where the partial logical block is not a last one, that is, i≦8, the operation returns to the step 808 and the control part 3 reads out the ith partial logical block of the jth physical block in the first physical block group and carries out processings at the steps 809 to 812 again. In the case where the partial logical block is a last one, that is, i>8 at the step 812, the control part 3 completes processing of the jth physical block and proceeds to processing of the next physical block.
At step 813, the control part 3 adds 1 to the physical block number j in the physical block group to 1. At step 814, the control part 3 determines whether the physical block is a last one in the physical block group or not, that is, j>2048 or not. In the case where the physical block is not a last one, that is, j≦2048, the operation returns to the step 804 and the control part 3 performs processing of the next physical block. In the case where the physical block is a last one, that is, j>2048, the control part 3 completes processing of the first physical block group and proceeds to processing of the second physical block group.
At step 815, the control part 3 initializes physical block group number k by the default value 2. At step 816, the control part 3 initializes physical block number j in the physical block group by the default value 1.
At step 817, the control part 3 reads out the first partial logical block of the jth physical block in the kth physical block group. At step 818, in accordance with the first data of a leading page of the physical block read out, the control part 3 determines whether the physical block is a cleared one or not. In the case of the cleared physical block, the entry table has been already initialized with the default value 1 (cleared) at the step 801 and therefore the control part 3 completes the processing of the jth physical block without doing anything. In the case where it is the written physical block, the operation proceeds to step 819 and the third table generation means writes 0 (written) in the field of the physical block of the entry table.
At step 820, the control part 3 adds 1 to the physical block number j in the physical block group. At step 821, the control part 3 determines whether the physical block is a last one in the physical block group or not, that is, j>2048 or not. In the case where the physical block is not a last one, that is, j≦2048, the operation returns to the step 817 and the control part 3 performs processing of the next physical block. In the case where the physical block is a last one, that is, j>2048, the control part 3 completes processing of the kth physical block group and proceeds to processing of the next physical block group.
At step 822, the control part 3 adds 1 to the physical block group number k to 1. At step 823, the control part 3 determines whether the physical block group is a last one or not, that is, k>8 or not. In the case where the physical block group is not a last one, that is, k≦8, the operation returns to the step 816 and the control part 3 carries out processing of the next physical block group. In the case where the physical block group is a last one, that is, k>8, this flowchart ends.
In this way, when the nonvolatile storage device is inserted into a main body, the nonvolatile storage device 1 generates an address control table including an address translation table for translating logical address designated by the main body into physical address of the nonvolatile storage device. Accordingly, time required for generating the address control table (hereinafter referred to as initialization time) increases in proportion to capacity of the nonvolatile memory.
In these days, the tendency has been toward an increase in information volume handled by portable devices, and in order to deal with the tendency, storage capacity of the nonvolatile storage device has also increased.
The increase in memory capacity, however, has caused an increase in initialization time. It is impossible to provide an external data access to the nonvolatile storage device having the nonvolatile memory during initialization time. In other words, the problem is that, after inserting the nonvolatile storage device into the portable device, time required to recognize the nonvolatile storage device by the portable device, that is, time during which the user cannot operate the portable device has increased.
The present invention solves the above-mentioned conventional problem and intends to provide a nonvolatile storage device and control method thereof which enable to improve convenience of portable devices by shortening initialization time.